Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Part V: Debugging and Testing

Part V: Debugging and Testing

Chapter 29: Software Unit Testing Frameworks

Chapter 30: Debugging with GDB

Chapter 31: Code Hardening

Chapter 32: Coverage Testing with GNU gcov

Chapter 33: Profiling with GNU gprof

Chapter 34: Advanced Debugging Topics

This final part of the book looks at the topics of debugging and testing. This includes unit testing frameworks, using the GNU source-level debugger, advanced debugging techniques (including memory debugging), and finally code-hardening techniques for creating higher quality and more reliable GNU/Linux applications.

Chapter 29: Software Unit Testing Frameworks

The topic of software testing is an important one with quite a bit of development in the open source community. After an introduction to unit and system testing, unit testing frameworks are explored, including a look at how to make your own and at two open source distributions. The expect utility is also covered as a means to test applications at a high level.

Chapter 30: Debugging with GDB

The GNU Debugger (GDB) is a source-level debugger that is a staple for GNU/Linux application development. GDB is integrated into the GNU toolchain and offers both command-line and GUI versions. This chapter presents GDB in a tutorial fashion and walks through the debugging of a simple application using breakpoints. Features such as data inspection and stack frame viewing and the GDB commands used most are covered. More advanced features for multiprocess and multithreaded application debugging and core-dump file debugging are also discussed.

Chapter 31: Code Hardening

The topic of code hardening, otherwise known as defensive programming, is an umbrella for a variety of techniques that have the goal of increasing the quality and reliability of software. This chapter looks at numerous coding methods as well as tools (such as static source-checking tools) to help build better software.

Chapter 32: Coverage Testing with GNU gcov

In this chapter, the topic of testing is analyzed from the perspective of coverage testing using the gcov utility. The gcov utility provides a way to identify path execution of an application. This tool can be very useful in determining full test path coverage of an application (where all paths are taken for a given regression of an application). It can also be useful in identifying how often a given path was taken and, therefore, is a useful performance tool.

Chapter 33: Profiling with GNU gprof

Profiling tools can be useful in identifying where the majority of time is taken for a given application. This chapter investigates the gprof utility, which can be used to help focus optimization efforts in an application by profiling the application to see where the majority of time is spent.

Chapter 34: Advanced Debugging Topics

This final chapter explores a number of debugging topics including memory debugging. Some of the most difficult debugging can center around memory management, so this chapter reviews a number of techniques and open source tools for supporting memory debugging. We’ll also explore some of the cross-referencing tools as well as some useful tracing tools.



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial