Testing, debugging, and using support libraries

Slides:



Advertisements
Similar presentations
6 Copyright © 2005, Oracle. All rights reserved. Building Applications with Oracle JDeveloper 10g.
Advertisements

Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Copyright  Oracle Corporation, All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
C# Programming: From Problem Analysis to Program Design1 Debugging and Handling Exceptions C# Programming: From Problem Analysis to Program Design 3 rd.
MT311 Tutorial Li Tak Sing( 李德成 ). Uploading your work You need to upload your work for tutorials and assignments at the following site:
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Visual Basic Debugging Tools Appendix D 6/27/20151Dr. Monther Aldwairi.
JavaScript, Fourth Edition
CIT 590 Debugging. Find a laptop Please take a moment to open up your laptop and open up Eclipse. If you do not have a laptop, please find a friend. If.
DEBUGGERS For CS302 Data Structures Course Slides prepared by TALHA OZ (most of the text is from
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
ASP.NET Programming with C# and SQL Server First Edition Chapter 6 Debugging and Error Handling.
Debugging applications, using properties Jim Warren – COMPSCI 280 S Enterprise Software Development.
DEBUGGING CHAPTER Topics  Getting Started with Debugging  Types of Bugs –Compile-Time Bugs –Bugs Attaching Scripts –Runtime Errors  Stepping.
Debugging Dwight Deugo Nesa Matic
Debugging. 2 © 2003, Espirity Inc. Module Road Map 1.Eclipse Debugging  Debug Perspective  Debug Session  Breakpoint  Debug Views  Breakpoint Types.
Debugging in Java. Common Bugs Compilation or syntactical errors are the first that you will encounter and the easiest to debug They are usually the result.
Object Oriented Software Development 8. Exceptions, testing and debugging.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Eclipse debugger.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Debugging Xin Tong. GDB GNU Project debugger Allows you to see what is going on `inside' another program while it executes or crashed. (Faster than printing.
Mobile Programming Lecture 3 Debugging. Lecture 2 Review What widget would you use to allow the user to enter o a yes/no value o a range of values from.
Debuggers in Python. The Debugger Every programming IDE has a tool called a debugger. This application does NOT locate or fix your bugs for you! It slows.
Copyright © 2004 – 2013 Curt Hill Java Debugging In Eclipse.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Slide 1 What we'll cover here l Using the debugger: Starting the debugger Setting.
Open project in Microsoft Visual Studio → build program in “Release” mode.
Debug in Visual Studio Windows Development Fundamentals LESSON 2.5A.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
CHAPTER 10 ERROR HANDLING & DEBUGGING JavaScript can be hard to learn. Everyone makes mistakes when writing it.
15 Copyright © 2004, Oracle. All rights reserved. Debugging Triggers.
Netbeans QuickStart. Creating a project File->New Project –For now you want General->Java Application –Then fill in the project details.
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
Debugging M-Files Steve Gu Feb 08, Outline What’s Debugging? Types of Errors Finding Errors Debugging Example Using Debugging Features.
Error Analysis Logic Errors.
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Debugging and Handling Exceptions
How to debug an application
Dept of Computer Science University of Maryland College Park
CS1101X Programming Methodology
Debugging Dwight Deugo
Testing and Debugging.
Mobile Application Development Chapter 5 [Persistent Data in Android]
Computer Programming I
Debugging CMSC 202.
The Android Activity Lifecycle
Using Visual Studio with C#
Important terms Black-box testing White-box testing Regression testing
DEBUGGING.
Important terms Black-box testing White-box testing Regression testing
Debugging with Eclipse
CIS 470 Mobile App Development
Test Automation For Web-Based Applications
DEBUGGING JAVA PROGRAMS USING ECLIPSE DEBUGGER
Android Developer Fundamentals V2 Lesson 1
Using a Debugger 1-Jan-19.
Debugging Taken from notes by Dr. Neil Moore
Debuggers and Debugging
Our Environment We will exercise on Microsoft Visual C++ v.6
Debugging Taken from notes by Dr. Neil Moore
Debugging Visual Basic Programs
CIS 470 Mobile App Development
Debugging Dwight Deugo
How to debug a website using IE F12 tools
Code Composer Essentials 3.0
CMPE212 – Reminders Assignment 2 due today, 7pm.
Corresponds with Chapter 5
Debugging with Eclipse
Workshop for Programming And Systems Management Teachers
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

Testing, debugging, and using support libraries Android Developer Fundamentals V2 Testing, debugging, and using support libraries Lesson 3

3.1 The Android Studio debugger

All Code Has Bugs

Bugs Incorrect or unexpected result, wrong values Crashes, exceptions, freezes, memory leaks Causes Human Design or Implementation Error > Fix your code Software fault, but in libraries > Work around limitation Hardware fault or limitation -> Make it work with what's available Origin of the term "bug" (it's not what you think)

Debugging Find and fix errors Correct unexpected and undesirable behavior Unit tests help identify bugs and prevent regression User testing helps identify interaction bugs Android Studio has tools that help you

Logging with Android Studio

Add Log messages to your code import android.util.Log; // Use class variable with class name as tag private static final String TAG = MainActivity.class.getSimpleName(); // Show message in Logcat pane of Android Studio // Log.<log-level>(TAG, "Message"); Log.d(TAG, “Hello World”);

Open Logcat pane Logcat pane Logcat tab

Inspect logging messages Log.d("MainActivity", "Hello World"); 09-12 14:28:07.971 4304 /com.example.android.helloworld D/MainActivity: Hello World

Choose visible logging level Displays logs with levels at this level or higher

Log Levels Verbose - All verbose log statements and comprehensive system Debug - All debug logs, variable values, debugging notes Info - Status info, such as database connection Warning - Unexpected behavior, non-fatal issues Error - Serious error conditions, exceptions, crashes only

Debugging with Android Studio

What you can do Run in debug mode with attached debugger Set and configure breakpoints Halt execution at breakpoints Inspect execution stack frames and variable values Change variable values Step through code line by line Pause and resume a running program

Run in debug mode 1 Debugger pane opens Menu: Run > Debug 'your app' 2

Click in the left margin next to executable line of code Set breakpoints Click in the left margin next to executable line of code

Edit breakpoint properties 2 1

Make breakpoints conditional In properties dialog or right -click existing breakpoint Any Java expression that returns a boolean Code completion helps you write conditions

Run until app stops at breakpoint First Breakpoint Frames Variables in scope Watches (C/C++)

Inspect frames Top frame is where execution is halted in your code

Inspect and edit variables Right-click on variable for menu

Basic Stepping Commands Step Over F8 Step to the next line in current file Step Into F7 Step to the next executed line Force Step Into ⇧F7 Step into a method in a class that you wouldn't normally step into, like a standard JDK class Step Out ⇧F8 Step to first executed line after returning from current method Run to Cursor ⌥F9 Run to the line where the cursor is in the file There are other stepping commands.

Stepping through code Show execution point Drop frame Run to cursor Step over Step into Step out Force step into

Resume and Pause Resume Pause Mute all breakpoints Menu: Run->Pause Program… Run->Resume Program...

END