Samuel
Samuel

Reputation: 5733

Definition of debugging, profiling and tracing

Being new to systematic debugging, I asked myself what these three terms mean:

  1. Debugging
  2. Profiling
  3. Tracing

Anyone could provide definitions?

Upvotes: 32

Views: 14022

Answers (2)

benebo22
benebo22

Reputation: 271

In addition to the answer from Samuel:

  1. Debugging is the process of looking for bugs and their cause in applications. a bug can be an error or just some unexpected behaviour (e.g. a user complains that he/she receives an error when he/she uses an invalid date format). typically a debugger is used that can pause the execution of an application, examine variables and manipulate them.
  2. Profiling is a dynamic analysis process that collects information about the execution of an application. the type of information that is collected depends on your use case, e.g. the number of requests. the result of profiling is a profile with the collected information. the source for a profile can be exact events (see tracing below) or a sample of events that occured. because the data is aggregated in a profile it is irrelevant when and in which order the events happened.
  3. Tracing "trace is a log of events within to the program"(Whitham). those events can be ordered chronologically. thats why they often contain a timestamp. Tracing is the process of generating and collecting those events. the use case is typically flow analysis.

example tracing vs profiling:

Trace:
[2021-06-12T11:22:09.815479Z] [INFO] [Thread-1] Request started
[2021-06-12T11:22:09.935612Z] [INFO] [Thread-1] Request finished
[2021-06-12T11:22:59.344566Z] [INFO] [Thread-1] Request started
[2021-06-12T11:22:59.425697Z] [INFO] [Thread-1] Request finished

Profile: 
2 "Request finished" Events
2 "Request started" Events

so if tracing and profiling measure the same events you can construct a profile from a trace but not the other way around.
source
Whitham: https://www.jwhitham.org/2016/02/profiling-versus-tracing.html
IPM: http://ipm-hpc.sourceforge.net/profilingvstracing.html

Upvotes: 15

Samuel
Samuel

Reputation: 5733

Well... as I was typing the tags for my question, it appeared that stack overflow already had defined the terms in the tags description. Here their definitions which I found very good:

Remote debugging is the process of running a debug session in a local development environment attached to a remotely deployed application.

Profiling is the process of measuring an application or system by running an analysis tool called a profiler. Profiling tools can focus on many aspects: functions call times and count, memory usage, cpu load, and resource usage.

Tracing is a specialized use of logging to record information about a program's execution.

Upvotes: 28

Related Questions