Ebook: Pro Python best practices: debugging, testing and maintenance
Author: Rother Kristian
- Tags: Débogage, Python (Langage de programmation)
- Year: 2017
- Publisher: Apress
- City: United States
- Language: English
- pdf
Learn software engineering and coding best practices to write Python code right and error free. In this book you'll see how to properly debug, organize, test, and maintain your code, all of which leads to better, more efficient coding. Software engineering is difficult. Programs of any substantial length are inherently prone to errors of all kinds. The development cycle is full of traps unknown to the apprentice developer. Yet, in Python textbooks little attention is paid to this aspect of getting your code to run. At most, there is a chapter on debugging or unit testing in your average basic Python book. However, the proportion of time spent on getting your code to run is much higher in the real world. Pro Python Best Practices aims to solve this problem. You will: Learn common debugging techniques that help you find and eliminate errors Gain techniques to detect bugs more easily ver best="" practices="" to="" prevent="" bugscarry="" out="" automated="" testing="" discover="" problems="" faster Use best practices to maintain a project over a long time Learn techniques to keep your project under control.;Chapter 2: Exceptions in PythonExceptions Are Defects We Know About; Reading the Code; SyntaxError; Best Practices for Debugging SyntaxErrors; Examining the Error Message; The Error Type; The Error Description; The Traceback; Deduction; Catching Exceptions; Best Practices for Debugging IOErrors; Errors and Defects; Where Do Defects Come From?; The Correct Code; Best Practices; Chapter 3: Semantic Errors in Python; Comparing Expected and Factual Output; Defects; Defects in Variable Assignments; Multiple Initialization; Accidental Assignment; Accidental Comparison.;Overview of IPython CommandsExploring Namespaces; Exploring Namespaces with dir(); Exploring Namespaces of Objects; Exploring Attributes in a Python Program; Alternatives to dir in IPython; Namespace Mechanics; Python Uses Namespaces for Its Own Functions; Modifying a Namespace; Namespaces and Local Scope; Namespaces Are a Core Feature of Python; Using Self-Documenting Objects; Accessing Docstrings with help(); Object Summaries in IPython; Analyzing Object Types; Checking Object Identity; Checking Instances and Subclasses; Practical Use of Introspection; Finding Typos with Introspection.;Explain the Problem to Someone ElsePair Programming; Code Reviews; Reading; Cleaning Up; The Scientific Method and Other Best Practices; Best Practices; Chapter 5: Debugging with print Statements; Diagnose Whether Code Was Executed; Print the Content of Variables; Pretty-Printing Data Structures; Simplify Input Data; Start with Minimal Input; Gradually Add More Input Data; Switching print Output On and Off; Complete Code; Pros and Cons of Using print Statements; Best Practices; Chapter 6: Debugging with Introspection Functions; Explorative Coding in IPython; Exploring Files and Directories.;At a Glance; Contents; About the Author; About the Technical Reviewer; Acknowledgments; Preface; Chapter 1: Introduction; A Lesson in Humility; The Case for Best Practices in Python; The Origin of Best Practices; Hacking; Software Engineering; Agile; Software Craftsmanship; Who This Book Is For; What This Book Is About; Part 1: Debugging; Part 2: Automated Testing; Part 3: Maintenance; Further Benefits; The MazeRun Game; How to Use This Book?; Install Python 3; Install the Pygame Library; Install a Text Editor; Download the Source Code Examples; Part I: Debugging.;Wrong Variables in an ExpressionSwapped Literals in Expression; Defects in Indexing; Creating Wrong Indices; Using Wrong Indices; Defects in Control Flow Statements; Defects in Boolean Expressions; Defects with Indentation; Defects in Using Functions; Omitting a Function Call; Missing Return Statement; Not Storing the Return Value; Error Propagation; Best Practices; Chapter 4: Debugging with the Scientific Method; Applying the Scientific Method; Reproducing the Error; Automating the Error; Isolating the Defect; The Strip-Down Strategy; The Binary Search Strategy; Getting Help; Taking a Break.
Download the book Pro Python best practices: debugging, testing and maintenance for free or read online
Continue reading on any device:
Last viewed books
Related books
{related-news}
Comments (0)