Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Design Patterns with Delphi

You're reading from   Hands-On Design Patterns with Delphi Build applications using idiomatic, extensible, and concurrent design patterns in Delphi

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781789343243
Length 476 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Primož Gabrijelčič Primož Gabrijelčič
Author Profile Icon Primož Gabrijelčič
Primož Gabrijelčič
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: Design Pattern Essentials FREE CHAPTER
2. Introduction to patterns 3. Section 2: Creational Patterns
4. Singleton, Dependency Injection, Lazy Initialization, and Object Pool 5. Factory Method, Abstract Factory, Prototype, and Builder 6. Section 3: Structural Patterns
7. Composite, Flyweight, Marker Interface, and Bridge 8. Adapter, Proxy, Decorator, and Facade 9. Section 4: Behavioral Patterns
10. Nullable Value, Template Method, Command, and State 11. Iterator, Visitor, Observer, and Memento 12. Section 5: Concurrency Patterns
13. Locking patterns 14. Thread pool, Messaging, Future and Pipeline 15. Section 6: Miscellaneous Patterns
16. Designing Delphi Programs 17. Other Kinds of Patterns 18. Other Books You May Enjoy

Debugging

Fixing bugs in a complex program can be a complicated task. Sometimes, bugs are straighforward, while others are hard to reproduce or fall into the "there's no way that the current code produces this result" area.

A good programmer doesn't use random changes to the code to fix problems but approaches debugging methodically. Different people use different debugging approaches, but they can be typically summarized in the following steps:

  1. Gather the data.
  2. Develop a hypothesis.
  3. Test the hypothesis.
  4. Repeat until the test succeeds.
  5. Add a test to the unit tests.

The last step (regression testing) is especially important as it prevents the bug to be accidentally reentered into the code by merging the incorrect version of the source.

To really fix a bug, you have to reproduce it first. Fixing a bug that you can't repeat is just performing guesswork...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime