-
Notifications
You must be signed in to change notification settings - Fork 5
Intro to Debugging
Costin Grigore edited this page Mar 18, 2021
·
8 revisions
-
Notions: binary search,
git bisect -
The process is described tangentially here: http://raisercostin.org/2014/03/11/health-debugging-engineer-style
-
How debugging works
- We have a system that doesn't work properly.
-
Doesn't work properly means that under testing(specific set of steps) the expected result is different than the actual result. Notice here the parts and read more about them at Testing, Test-Driven-Development, Intro to Quality
- steps
- expected result
- actual result
- Having a bug means that at least once at some moment in the execution flow an operation creates a bit in the wrong way: 0 when should be 1 or the other way.
- In practice most probably there are multiple bits that are created wrongly but we focus on finding any one of them (we will try to find first in the execution flow but we can't be sure). After we fix any of the bits we can move to second and so on. This means that any system with bugs can be reduced to a system with one bug + a system with the rest of the bugs.
- With this context debugging means: find the bit that is wrongly created and conclude that the piece of code that created/influenced it is the buggy one. The buggy piece of code is initially the whole system and via debugging you're getting closer and closer to the smallest piece of code that is buggy. In the end you should find the one line of code to be blamed (an operation code that should be other operation code).
- There are at least 3 types of going from buggy-system to buggy-line-of-code:
- Code Inspection - Traverse entire code base in a specific way:
- Change Review - start with latest changes - see and learn to use
git bisect - Code Review - reviewing is rarely doing deep analysis. The deepest analysis is made when things are created/wrote not on read.
- Exhaustive Inspection Analysis
- Static Code Analysis - see tools for this but this is undirected bug hunting: the bugs might have a small impact
- Exhaustive Human Code Analysis - nobody is doing that except for rocket, aviation and nuclear industries
- Change Review - start with latest changes - see and learn to use
- Fast Debugging - This type of debugging is based on intuitions on what's most probable cause of the issue. See where is the bug?
-
Methodical Debugging
- terms:
- synonyms: thorough, complete with regard to every detail; not superficial or partial, rigorous, in-depth, exhaustive, minute, detailed, close, meticulous, scrupulous, assiduous, conscientious, painstaking, methodical, careful, sedulous, complete, comprehensive, elaborate, full, intensive, extensive, widespread, sweeping, searching, all-embracing
- sinonime: aprofundat, temeinic, complet, detaliat, amănunţit, minuţios, profund, conştiincios, perfect, desăvârşit, total, scrupulos, absolut
- This method assumes knowing what binary search is. What we're doing is a binary search in the execution space (pre-order traversal of the execution tree where each node is a block of code that could execute other blocks) that is a specific technique based on the Divide and Conquer (Divide et Impera) general strategy.
- terms:
- Code Inspection - Traverse entire code base in a specific way:
- Home
- Advices
- Development Algorithm
- Who's who
- Software Books
- Career, salary, salariu, brut, net, Levels
-
Tools
- Health
- Physical Tools
- Environment Tools
- File Tools
- Source Tools
- Information Tools
- Collaboration Tools
- Infrastructure Tools
- Language Tools
-
Concepts as Tools spec maturity
- Classes of Objects, Development Algorithm/mantra/practices
- Streaming Tools
- Process Tools psychology, analytical paralysis
- Special
- fiddler kotlin,javascript,scala
- translator scala->kotlin, java->kotlin
- Guides
- Asking for Help
- Aspects
- Security
- Server & Networking load balancing,
-
Principles & Guidelines
- PLS - Principle of Least Surprise (aka no puzzlers)
- SRP - Single Responsibility Principle
- KISS - Keep It Simple
- YAGNI - You aint gona need it
- DRY - Dont Repeat Yourself
- Fail Fast
- OCP - Open Closed
- POE - Premature Optimization is Evil
- LSP - Liskov Substitution Principle
- DIP - Dependency Inversion Principle / Inversion of Control
- Hollywood Principle - Don't call us We call you
- Tell Don't Ask
- Event sourcing
- NIHS - Not invented here syndrome
- Patterns - idioms, best practices, code smells
-
Intro to Problems - common problems: cache, logging, config, representing date, time, money
- Intro to Libraries - reactive, reactor, commons, collections, apache, guava, logging, config, time, test, junit, vavr, immutable, lombok, mapping, mapstruct, time, joda, cache, Guava, Caffeine, and cache2k
- Intro to DateTime
- Intro to Logging
- Intro to Concurrency - thread, parallelism
- Intro to I18N - internationalization, encoding, unicode, big indian, little indian, ascii, utf, utf8, utf16, formatting, parsing, transliteration, charset, localization, time, timezone, zone id, zone offset, GMT
- Intro to Numbers - rounding, ceil, floor, base, integer, decimal, precision, mantis, exponent, significant, statistics
- Java Idioms
- Concepts
- Code Changes refactor, format, eol, bugfix, newfeature
- Convention Over Configuration
- Continuous Integration
- Continuous Delivery
- Code License
- Fluent Interface
- Semantic Versioning
- Take It Offline
- Flow
- Languages
- Hardening
- Smells
-
Intros
- Intro to Paradigms Object Oriented, Functional, Procedural, Asynchronous
- Intro to Logic
- Intro to Product UX, UI, business, technical, backend, frontend
- Intro to Roles
- Intro to Decision Levels : business, financials, domain, product, architecture, high level design, low level design, coding, debugging, quality, roles, stakeholders
- Intro to Steps
- Intro to Software Architecture
- Intro to Software Design
- Intro to UML state machine diagram, class diagram, sequence diagram
- Intro to Graphical Design
- Intro to Performance bigO, algorithm complexity
- Intro to Agile
- Intro to Scripting
- Intro to Shell execution, environment, registry, powershell, cmd, cmder, linux, bash, ash, csh, zsh, ksh
- Intro to Wiki
-
Intro to Building
- Intro to DevMachine
- Intro to Git
- Intro to Maven
- Intro to Docker
- Intro to Hosting Deploy, nameserver, hostname, registrar, ssl, ddns, dns, naked domain, wildcard domain, email, smtp, pop3, imap, DKIM, SPF, spam
-
Intro to Landscapes Language Environments, Web Landscape
- Intro to JVM Landscape
-
Intro to Javascript Landscape
- Intro to Javascript
- Intro to Typescript binding, implicit, explicit, default (global), callsite, lambda, callback, function, promise, async await
- Intro to Node javascript, npm, yarn
- Intro to DotNet Landscape C# csharp
- Intro to Golang
- Intro to Ruby
- Intro to Python
- Coding Style
- Phases
-
Intro to Quality - QA, Quality Assurance, code quality, bugs, bug levels, metabugs
- Intro to Tests
-
Test Driven Development TDD, mantra
- Domain-and-Test-Driven-Design Advanced topics
- Intro to Coding defensive, offensive, preconditions, postconditions
- Intro to Debugging
- Intro to Profiling, Intro to Performance
- Intro to Code Review
-
Intro to Quality - QA, Quality Assurance, code quality, bugs, bug levels, metabugs
- Intro to Functional
- Intro to Computers memory, cpu, hardware, neuman, computer science, devices
- Intro to OFM
- Intro to Databases Intro to Database Migration ORM, ObjectRelationalMapping, Hibernate, JPA, ebeanorm
- Advanced in Databases - optimistic lock, pessimistic lock
- Intro to WebDevelopment - tcp, http
- Data Structures & money
- Intro to Virtualization
- Admin section
- Intro to Types value, record, case class, alias
- Intro to Layers - frontend,ui,ux
- Intro to Culture - teams, psychology, principles, behaviour
- Intro to 41 - aboriginal linux, google whitepapers
- Intro to Security - ssl, handshake, tsl, https, basic auth, tokens, refresh, jwt tokens, access, refresh
- Intro to Crypto
- Advanced
- Advanced Java
- Circuit Breaker, retry, bulkhead, RateLimit, resilience
- Immutable, purity, pure functions, functional style
- Identification Surrogate vs Natural Keys, database, rest, microservice
- Infrastructure devops, docker, containers, kubernetes, k8s, private cloud, continous deployment
- Resources
- Project Templates
- Ships
- Ship10 - 2021-Aug
- Ship 1 - 2017-May
- Ship 2 - 2017-June
- Ship 3 - 2017-July
-
Ship 4 - 2017-September
- Team 4
- Team 4 Reloaded
- Backlog 4
- Sprint 4.1 old
- Sprint 4.1 Home old
- Sprint 4.2 old
- Sprint 4.2 Home old
- Sprint 4.3 old
- Sprint 4.3 Home old
- Sprint 4.4 old
- Sprint 4.4 Home old
- Sprint 4.5 old
- Sprint 4.5 Home old
- Sprint 4.6 old
- Sprint 4.6 Home old
- Sprint 4.7 old
- Sprint 4.7 Home old
- Sprint 4.8 old
- Sprint 4.8 Home old
-
Non software
- Physical Tools - home tooling