CSC/ECE 517 Fall 2009/wiki1b 1 ch: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
 
(48 intermediate revisions by the same user not shown)
Line 3: Line 3:
==Introduction==
==Introduction==


Debugging has been an important part of software development life cycle ever since the first computer program being introduced.  Programmers often find the process of finding bugs in their code to be a difficult, slow, tedious, and even frustrating.   
[http://en.wikipedia.org/wiki/Debugging Debugging] has been an important part of software development life cycle ever since the first computer program being introduced.  Since debugging often performed at the very end of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle software development life cycle], the cost of fixing bugs are higher.  Finding the cause of bugs within the code with complex architecture could be difficult, slow, tedious, and sometimes frustrating.  Researchers have been finding ways to increase the efficiency of debugging process, thus reducing the time required for the process.   


During the last decade, debugging techniques and tools have advanced immensely. The most popular tools used by programmers, from beginners to professionals, are probably Eclipse and NetBeans IDE. Both of these tools gained more popularity and success when they became an open-source project, with individuals and companies contributing to the project.
During the last decade, debugging techniques and tools have advanced immensely. Many of the most popular and widely used debugging tools are available for free and developed as open source projects.  The most popular tools used by programmers, starting from beginners to professionals, are probably [http://en.wikipedia.org/wiki/Eclipse_%28software%29 Eclipse] and [http://en.wikipedia.org/wiki/NetBeans NetBeans] [http://en.wikipedia.org/wiki/Integrated_development_environment IDE]. These IDEs are not only used by individual developers, but also widely used by developers working on commercial products.


==Debugging Steps==


==Academic Literature on Debugging==
Debugging process is divided into these three steps:
* Detecting failure
* Localizing fault
* Correcting fault


Researchers have been finding ways to increase the productivity of debugging process, from finding an algorithm to creating a tool that implements existing or new debugging techniquesSome of the most popular techniques in debugging are Delta Debugging and Fault Localization.
===Failure Detection===
Failure detection occurs during software testing.  Failure is first detected when program fails to run or does not pass the unit testsThe process of finding the failures started as simple as implementing the print line command such as below:


===Delta Debugging===
<pre>
Delta Debugging, developed by Professor [http://www.st.cs.uni-sb.de/zeller/ Andreas Zeller]'s group at Saarland University in Germany, is an automatic and systematic technique that deals with isolation of the source of the failure -- often the developer's longest, most demotivating, and most repetitive activity when carried out manually.<sup>[1]</sup> The algorithm isolates the difference between the passing and failing test case hence simplifies the number of test cases needed.
int i = 5;
int j = 3;
int k = i+j;
 
System.out.println("i is " + i);   
System.out.println("j is " + j);
System.out.println("i+j is " + k);
</pre>   
 
From the results printed in the console window, we can evaluate whether the code is doing what it supposed to do or not.  However, when the complexity of the code is growing and you need to work with multiple classes and packages, it will be more convenient to automate the testing process.  Automation tools such as [http://en.wikipedia.org/wiki/JUnit JUnit] comes in handy and provides programmers with information on which class or function failed.  The next step is to locate the exact statement or logic that caused the failures.
 
===Fault Localization===
 
Fault localization is a time consuming work.  Debugger tools usually come with advanced debugging features that help programmers trace through the code and find the exact location of the fault.  The Eclipse Platform provides a built-in Java language debugger with standard debugging functionality, including the ability to perform step execution, to set breakpoints and values, to inspect variables and values, and to suspend and resume threads. It can also be used to debug applications running on a remote machine.<sup>[2]</sup>
 
There are various research topics focused on debugging algorithm and tools that implement or enhance the algorithms.  Delta Debugging is an example of algorithm that helps narrow down the fault location.  While Visual Interactive Debugging Aids (VIDA) is an example of debugger tools that utilize breakpoint function and bring it to a whole new level.
 
====Delta Debugging====
[http://en.wikipedia.org/wiki/Delta_Debugging Delta Debugging], developed by Professor [http://www.st.cs.uni-sb.de/zeller/ Andreas Zeller]'s group at Saarland University in Germany, is an automatic and systematic technique that deals with isolation of the source of the failure -- often the developer's longest, most demotivating, and most repetitive activity when carried out manually.<sup>[1]</sup> The algorithm isolates the difference between the passing and failing test case hence simplifies the number of test cases needed.


Delta Debugging can be applied to isolate the cause of these different applications:
Delta Debugging can be applied to isolate the cause of these different applications:
Line 20: Line 43:
* Failure-inducing states (key presses, button presses, mouse clicks, etc.)
* Failure-inducing states (key presses, button presses, mouse clicks, etc.)


===Fault Localization===
====Visual Interactive Debugging Aids (VIDA)====
 
Visual Interactive Debugging Aids (VIDA) is a debugger tool which continuously recommends breakpoints for the programmer based on the analysis of execution information and the gathered feedback from the programmer <sup>[3]</sup>. VIDA is implemented as an Eclipse plug-in, which deals with Java programs with JUnit test cases.  It provides a program outline to record the debugging history and provides a static dependency graph to help the programmer make estimation at breakpoints.
===Whyline===
Whyline is an interactive debugging tool which is designed to help programmers locating the fault by allowing them to ask questions along the source code based on their dependency.
 
===Visual Interactive Debugging Aids (VIDA)===
Visual Interactive Debugging Aids (VIDA) is a debugging tool which continuously recommends breakpoints for the programmer based on the analysis of execution information and the gathered feedback from the programmer.


==Debugging and The Open-Source Community==
==Debugger and The Open-Source Community==


There are a lot of open source debugger tools that have become popular among professional developers.  They range from stand alone applications to Integrated Development Environment (IDE).  They provide many choices for developers to choose whether they want tools for specific languages, operating systems, algorithms, optional plug-ins, etc.  Two of the most popular IDEs that are widely used are Eclipse and NetBeans.  Both tools are open source, easy to use, and provide cross-platform environment.   
There are a lot of open source debugger tools that have become popular among professional developers.  They range from stand alone applications to Integrated Development Environment (IDE).  They provide many choices for developers to choose whether they want tools for specific languages, operating systems, algorithms, optional plug-ins, etc.  Two of the most popular IDEs that are widely used are Eclipse and NetBeans.  Both tools are open source, easy to use, and provide cross-platform environment.   


===Eclipse===
===Eclipse===
IBM developed Eclipse in the late 1990s and turned it over in 2001 to the nonprofit Eclipse Foundation. It became an open-source platform which enabled anyone to build applications using the technology. Eclipse is a popular choice, especially among Java developers, and often compared to NetBeans.
IBM developed Eclipse in the late 1990s and turned it over in 2001 to the nonprofit Eclipse Foundation. It became an open-source platform which enabled anyone to build applications using the technology. Eclipse is a popular choice, especially among Java developers, and often compared to NetBeans. A nice tutorial for Java debugging with Eclipse can be found [http://www.vogella.de/articles/EclipseDebugging/article.html here].


===NetBeans===
===NetBeans===
NetBeans is an open-source IDE developed in Java using the NetBeans Platform. NetBeans offer bundles for specific development needs, such as Java EE, Ruby, PHP, and C/C++.
NetBeans, owned by Sun Microsystems, is an open-source IDE developed in Java using the NetBeans Platform. NetBeans offer bundles for specific development needs, such as Java EE, Ruby, PHP, and C/C++.


===Debugging in Eclipse and NetBeans===
===Tarantula===
Eclipse and NetBeans come with debugging facilities, such as running and stopping the program, setting up breakpoints, keeping track of variables' value, watchpoint, hit count, etc. A nice tutorial for Java debugging with Eclipse can be found [http://www.vogella.de/articles/EclipseDebugging/article.html here].
 
===Advanced Debugging Tools===
 
 
====Tarantula====
Tarantula is a visualization system that displays the results of running suites of tests against software systems. By showing what portions of the code are executed by passed and failed tests, the system helps people identify faults in their programs. (http://pleuma.cc.gatech.edu/aristotle/Tools/tarantula/)  Tarantula automates the time-consuming debugging process of stepping through the code and verifying the values at each step.  It visualizes the suspicions of statements by different colors, ranging from red, yellow, to green.  The statements that are suspicious will be marked with red color, whereas the innocent statements marked by green color.
Tarantula is a visualization system that displays the results of running suites of tests against software systems. By showing what portions of the code are executed by passed and failed tests, the system helps people identify faults in their programs. (http://pleuma.cc.gatech.edu/aristotle/Tools/tarantula/)  Tarantula automates the time-consuming debugging process of stepping through the code and verifying the values at each step.  It visualizes the suspicions of statements by different colors, ranging from red, yellow, to green.  The statements that are suspicious will be marked with red color, whereas the innocent statements marked by green color.


(Insert example screenshot)
==Debugging in Commercial Software Development==


Debugging process in the commercial software development requires more than just a nice debugger.  The process often times involves a collaborative effort from a team of programmers and testers.  Fortunately, IDEs like Eclipse and NetBeans provide a wide array of plug-ins that can help with the collaboration work.  Developers using Eclipse have over 50 [http://en.wikipedia.org/wiki/List_of_Eclipse-based_software choices of plug-ins] that they can use to extend the Eclipse platform.


==References==


==Debugging in Commercial Software Development==
[1] [http://www.linux.com/archive/feature/46108 An Introduction to Delta Debugging by Alessandro Giusti]
 


==References==
[2] [http://www.ibm.com/developerworks/library/os-ecbug/ Debugging with the Eclipse Platform]


[1] [http://www.st.cs.uni-sb.de/zeller/ Andreas Zeller]: <cite>Why Programs Fail: A Guide to Systematic Debugging</cite>, Morgan Kaufmann, ISBN 1-55860-866-4
[3] ''VIDA: Visual Interactive Debugging.'' Hao et al. [http://www.cs.uoregon.edu/events/icse2009/home/ ''IEEE 31st International Conference on Software Engineering'']. Vancouver, Canada, May 2009.

Latest revision as of 16:26, 29 September 2009

Advances in Debugging

Introduction

Debugging has been an important part of software development life cycle ever since the first computer program being introduced. Since debugging often performed at the very end of software development life cycle, the cost of fixing bugs are higher. Finding the cause of bugs within the code with complex architecture could be difficult, slow, tedious, and sometimes frustrating. Researchers have been finding ways to increase the efficiency of debugging process, thus reducing the time required for the process.

During the last decade, debugging techniques and tools have advanced immensely. Many of the most popular and widely used debugging tools are available for free and developed as open source projects. The most popular tools used by programmers, starting from beginners to professionals, are probably Eclipse and NetBeans IDE. These IDEs are not only used by individual developers, but also widely used by developers working on commercial products.

Debugging Steps

Debugging process is divided into these three steps:

  • Detecting failure
  • Localizing fault
  • Correcting fault

Failure Detection

Failure detection occurs during software testing. Failure is first detected when program fails to run or does not pass the unit tests. The process of finding the failures started as simple as implementing the print line command such as below:

 int i = 5;
 int j = 3;
 int k = i+j;

 System.out.println("i is " + i);     
 System.out.println("j is " + j);
 System.out.println("i+j is " + k); 

From the results printed in the console window, we can evaluate whether the code is doing what it supposed to do or not. However, when the complexity of the code is growing and you need to work with multiple classes and packages, it will be more convenient to automate the testing process. Automation tools such as JUnit comes in handy and provides programmers with information on which class or function failed. The next step is to locate the exact statement or logic that caused the failures.

Fault Localization

Fault localization is a time consuming work. Debugger tools usually come with advanced debugging features that help programmers trace through the code and find the exact location of the fault. The Eclipse Platform provides a built-in Java language debugger with standard debugging functionality, including the ability to perform step execution, to set breakpoints and values, to inspect variables and values, and to suspend and resume threads. It can also be used to debug applications running on a remote machine.[2]

There are various research topics focused on debugging algorithm and tools that implement or enhance the algorithms. Delta Debugging is an example of algorithm that helps narrow down the fault location. While Visual Interactive Debugging Aids (VIDA) is an example of debugger tools that utilize breakpoint function and bring it to a whole new level.

Delta Debugging

Delta Debugging, developed by Professor Andreas Zeller's group at Saarland University in Germany, is an automatic and systematic technique that deals with isolation of the source of the failure -- often the developer's longest, most demotivating, and most repetitive activity when carried out manually.[1] The algorithm isolates the difference between the passing and failing test case hence simplifies the number of test cases needed.

Delta Debugging can be applied to isolate the cause of these different applications:

  • Failure-inducing input
  • Failure-inducing changes (adding / updating / deleting variables, functions, classes, etc.)
  • Failure-inducing states (key presses, button presses, mouse clicks, etc.)

Visual Interactive Debugging Aids (VIDA)

Visual Interactive Debugging Aids (VIDA) is a debugger tool which continuously recommends breakpoints for the programmer based on the analysis of execution information and the gathered feedback from the programmer [3]. VIDA is implemented as an Eclipse plug-in, which deals with Java programs with JUnit test cases. It provides a program outline to record the debugging history and provides a static dependency graph to help the programmer make estimation at breakpoints.

Debugger and The Open-Source Community

There are a lot of open source debugger tools that have become popular among professional developers. They range from stand alone applications to Integrated Development Environment (IDE). They provide many choices for developers to choose whether they want tools for specific languages, operating systems, algorithms, optional plug-ins, etc. Two of the most popular IDEs that are widely used are Eclipse and NetBeans. Both tools are open source, easy to use, and provide cross-platform environment.

Eclipse

IBM developed Eclipse in the late 1990s and turned it over in 2001 to the nonprofit Eclipse Foundation. It became an open-source platform which enabled anyone to build applications using the technology. Eclipse is a popular choice, especially among Java developers, and often compared to NetBeans. A nice tutorial for Java debugging with Eclipse can be found here.

NetBeans

NetBeans, owned by Sun Microsystems, is an open-source IDE developed in Java using the NetBeans Platform. NetBeans offer bundles for specific development needs, such as Java EE, Ruby, PHP, and C/C++.

Tarantula

Tarantula is a visualization system that displays the results of running suites of tests against software systems. By showing what portions of the code are executed by passed and failed tests, the system helps people identify faults in their programs. (http://pleuma.cc.gatech.edu/aristotle/Tools/tarantula/) Tarantula automates the time-consuming debugging process of stepping through the code and verifying the values at each step. It visualizes the suspicions of statements by different colors, ranging from red, yellow, to green. The statements that are suspicious will be marked with red color, whereas the innocent statements marked by green color.

Debugging in Commercial Software Development

Debugging process in the commercial software development requires more than just a nice debugger. The process often times involves a collaborative effort from a team of programmers and testers. Fortunately, IDEs like Eclipse and NetBeans provide a wide array of plug-ins that can help with the collaboration work. Developers using Eclipse have over 50 choices of plug-ins that they can use to extend the Eclipse platform.

References

[1] An Introduction to Delta Debugging by Alessandro Giusti

[2] Debugging with the Eclipse Platform

[3] VIDA: Visual Interactive Debugging. Hao et al. IEEE 31st International Conference on Software Engineering. Vancouver, Canada, May 2009.