๐”– Scriptorium
โœฆ   LIBER   โœฆ

๐Ÿ“

Pro Python best practices: debugging, testing and maintenance

โœ Scribed by Rother, Kristian


Publisher
Apress
Year
2017
Tongue
English
Category
Library

โฌ‡  Acquire This Volume

No coin nor oath required. For personal study only.

โœฆ Synopsis


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.

โœฆ Table of Contents


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. 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. 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. 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. 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.

โœฆ Subjects


Dรฉbogage;Python (Langage de programmation)


๐Ÿ“œ SIMILAR VOLUMES


Pro Python Best Practices: Debugging, Te
โœ Kristian Rother ๐Ÿ“‚ Library ๐Ÿ“… 2017 ๐Ÿ› Apress ๐ŸŒ English

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 l

Pro Python best practices: debugging, te
โœ Rother, Kristian ๐Ÿ“‚ Library ๐Ÿ“… 2017 ๐Ÿ› Apress ๐ŸŒ English

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 l

Pro Python Best Practices: Debugging, Te
โœ Kristian Rother ๐Ÿ“‚ Library ๐Ÿ“… 2017 ๐Ÿ› Apress ๐ŸŒ English

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 substantia

Maintenance Benchmarking and Best Practi
โœ Ralph Peters ๐Ÿ“‚ Library ๐Ÿ“… 2006 ๐Ÿ› McGraw-Hill Professional ๐ŸŒ English

Over the past decade, companies have redirected their maintenance operational focus from internal cost-cutting to profit-maximization. This approach is referred to as profit centered maintenance. Peters provides maintenance supervisors and managers with a benchmarking/best practices road-map called

Maintenance and Reliability Best Practic
โœ Gulati, Ramesh ๐Ÿ“‚ Library ๐Ÿ“… 2009 ๐Ÿ› Industrial Press ๐ŸŒ English

In the maintenance and reliability (M&R) field, professionals are constantly challenged to implement the best way to ensure equipment is available as and when it is needed at a reasonable cost. To truly realize a best practice requires learning, re-learning, benchmarking and implementing better ways