Skip to content

Commit

Permalink
-iOS: new WWDC23 video {'Debugging and testing'}.
Browse files Browse the repository at this point in the history
  • Loading branch information
XLE22 committed Feb 1, 2024
1 parent 1cd7552 commit 107ca3e
Show file tree
Hide file tree
Showing 24 changed files with 169 additions and 11 deletions.
22 changes: 22 additions & 0 deletions src/assets/json/en/ios/wwdc/ios-wwdc-listnota11y.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@
"raccourcis": "2023/2310244",
"profils": ["All","DocC"]
},
{
"themes": "WWDC 2023",
"title": "Debug with structured logging",
"type": [],
"tests": [],
"verifier": [],
"resultat": [],
"exception": "",
"raccourcis": "2023/23DebuggingAndTesting",
"profils": ["All","Debugging"]
},
{
"themes": "WWDC 2023",
"title": "Design dynamic Live Activities",
Expand Down Expand Up @@ -131,6 +142,17 @@
"raccourcis": "2023/2310037",
"profils": ["All","Swift","SwiftUI"]
},
{
"themes": "WWDC 2023",
"title": "Fix failures faster with Xcode test reports",
"type": [],
"tests": [],
"verifier": [],
"resultat": [],
"exception": "",
"raccourcis": "2023/23DebuggingAndTesting",
"profils": ["All","Debugging","Optimization"]
},
{
"themes": "WWDC 2023",
"title": "Generalize APIs with parameter packs",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
134 changes: 134 additions & 0 deletions src/en/mobile/ios/wwdc/nota11y/2023/23DebuggingAndTesting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
title : "Debugging and testing"
abstract: "Improve your diagnostic experience through logging and learn how to use the test report in Xcode."

displayToc: true
---

# WWDC 2023: Debugging and testing
Find hereafter a detailed summary of two WWDC videos that belong to a [taxonomy of some WWDC footages](../../).

The original videos are available on the **Apple official website** ([session 10175](https://developer.apple.com/videos/play/wwdc2023/10175/), [session 10226](https://developer.apple.com/videos/play/wwdc2023/10226/)).

![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_Poster.png)

"Discover the **debug console in Xcode 15** and learn how you can **improve your diagnostic experience** through logging. Explore how you can navigate your logs easily and efficiently using **advanced filtering and improved visualization**. We'll also show you how to use the dwim-print command to **evaluate expressions** in your code while debugging."

"Discover how you can find, debug, and fix **test failures** faster with the **test report** in Xcode and Xcode Cloud. Learn how Xcode identifies failure patterns to help you find the right place to start investigating. We'll also show you how to use the UI automation explorer and video recordings to understand the events that led up to your **UI test failure**."

</br>Hereafter, the underlined elements **lead directly to the playback of the WWDC video** at the appropriate moment.
</br>

## Debugging
### [Console](https://developer.apple.com/videos/play/wwdc2023/10226/?time=49)
`Xcode 15` provides a brand **new `Debug Console`** with many features to be pointed out hereunder.

#### [Metadata](https://developer.apple.com/videos/play/wwdc2023/10226/?time=73)
The metadata can be customized through an **options button** and its content is cleverly placed below each log.
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_1.png)

#### [Log&nbsp;preview](https://developer.apple.com/videos/play/wwdc2023/10226/?time=112)
Besides the different options to be displayed below each log, it's also possible to have a quick overview of a single log by **pressing the space bar** after the selection thereof.
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_2.png)

#### [Filtering&nbsp;methods](https://developer.apple.com/videos/play/wwdc2023/10226/?time=141)
The new `Debug Console` provides some methods for offering **various filterings**: use the [filter&nbsp;bar](https://developer.apple.com/videos/play/wwdc2023/10226/?time=160), select the sought [log&nbsp;types](https://developer.apple.com/videos/play/wwdc2023/10226/?time=175) and [second&nbsp;click](https://developer.apple.com/videos/play/wwdc2023/10226/?time=185) a log.
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_3.png)
</br>

#### [Examples](https://developer.apple.com/videos/play/wwdc2023/10226/?time=215)
1. Use the **category filter** from the displayed popup⟹&nbsp;<a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10226/?time=269">🎬</a>
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_4.png)

2. Locate the code linked to the log writing⟹ <a alt="Click to playback the video footage." href="https://developer.apple.com/videos/play/wwdc2023/10226/?time=303">🎬</a>
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_5.png)
</br>

### [LLDB](https://developer.apple.com/videos/play/wwdc2023/10226/?time=445)
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_6.png)
Using `po` or `p`might become cumbersome when there's [no&nbsp;conformance](https://developer.apple.com/videos/play/wwdc2023/10226/?time=400) to the `CustomStringConvertible` protocol on the specific element.
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_7.png)

A new command called **[Do&nbsp;What&nbsp;I&nbsp;Mean&nbsp;Print](https://developer.apple.com/videos/play/wwdc2023/10226/?time=491)** has been added to be used at all times and to print the best possible description.
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_8.png)
The expression length has caused the `p` and `po` [aliases&nbsp;replacement](https://developer.apple.com/videos/play/wwdc2023/10226/?time=502) with this print command.
</br>

### Unified&nbsp;Logging
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_9.png)
Based on the rationale that `OSLog` is for [debugging](https://developer.apple.com/videos/play/wwdc2023/10226/?time=565), specific approaches to code writing may be [more&nbsp;appropriate](https://developer.apple.com/videos/play/wwdc2023/10226/?time=636)...
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_10.png)

... to provide log information in the [most&nbsp;efficient&nbsp;manner](https://developer.apple.com/videos/play/wwdc2023/10226/?time=671) that can be easily parsed and examined later.
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_11.png)
</br>

## Testing
### [The&nbsp;basics](https://developer.apple.com/videos/play/wwdc2023/10175/?time=66)
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_14.png)
Highlighting key terms about the `Xcode` testing gives rise to a better understanding of the tests structure concepts.

![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_13.png)

Refining the **runtime environment** for the tests and the **devices** on which they run are [critical&nbsp;parts](https://developer.apple.com/videos/play/wwdc2023/10175/?time=131) of testing.

![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_15.png)

The combination of the above explained notions lead towards a [structured&nbsp;idea](https://developer.apple.com/videos/play/wwdc2023/10175/?time=196) of testing.

![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_16.png)
</br>

### [Overview](https://developer.apple.com/videos/play/wwdc2023/10175/?time=267)
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_17.png)

The **test report** has been revised to provide a better user experience of what needs to be done for both the unit tests and the `UI` tests.

<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active"
data-bs-toggle="tab"
href="#DebAndTestOverview1"
id="DebAndTestOverview1_tab"
role="tab"
aria-selected="true">Unit&nbsp;tests</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link"
data-bs-toggle="tab"
href="#DebAndTestOverview2"
id="DebAndTestOverview2_tab"
role="tab"
aria-selected="false">UI&nbsp;tests</a>
</li>
</ul>

<div class="tab-content">
<div class="tab-pane show active" id="DebAndTestOverview1" role="tabpanel">

<a alt="Click to playback the footage at the appropriate moment regarding the unit test within the test report" href="https://developer.apple.com/videos/play/wwdc2023/10175/?time=361">🎬</a>

The test report summary enables to get a glimpse of the tests health condition.
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_19.png)

The **insights** are made for highlighting the **common failure patterns** and the **longest test runs**: working with them guides the [resolution](https://developer.apple.com/videos/play/wwdc2023/10175/?time=462) towards specific **test method runs** and finally towards the **test details view**.
</div>

<div class="tab-pane" id="DebAndTestOverview2" role="tabpanel">

<a alt="Click to playback the footage at the appropriate moment regarding the ui test within the test report" href="https://developer.apple.com/videos/play/wwdc2023/10175/?time=579">🎬</a>

A selected failure leads towards the **test details view** that displays an **activities tab** including three different items whose interactivity comes with a smoother experience for debugging this kind of tests: the **[test&nbsp;activity](https://developer.apple.com/videos/play/wwdc2023/10175/?time=603)**, the **[automation&nbsp;explorer](https://developer.apple.com/videos/play/wwdc2023/10175/?time=617)** and the **[scrubber](https://developer.apple.com/videos/play/wwdc2023/10175/?time=626)**.

![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_18.png)
</div>
</div>
</br>
</br>

### [Example](https://developer.apple.com/videos/play/wwdc2023/10175/?time=660)
The automation explorer is synchronously updated with the events within the test activity layer, moving the scrubber to the appropriate moments.
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_20.png)

Fixing a failure through the test details view may be quite simple and quick by using these new above pieces that make the test debugging experience interactive like never before.
![](../../../../../images/iOSdev/wwdc23-DebugAndTesting_21.png)
24 changes: 13 additions & 11 deletions src/en/mobile/ios/wwdc/nota11y/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ The videos that may be of interest to **designers** are highlighted with a **ded

<section class="visually-hidden" id="wwdcTests" aria-hidden="true">
<h2 id="hhwwdc2023" class="pt-5">WWDC 2023</h2>
<p id="hwwdc84">WWDC 2023 Animate symbols in your app</p>
<p id="hwwdc83">WWDC 2023 Bring widgets to life</p>
<p id="hwwdc82">WWDC 2023 Bring widgets to new places</p>
<p id="hwwdc81">WWDC 2023 Build accessible apps with SwiftUI and UIKit</p>
<p id="hwwdc80">WWDC 2023 Build programmatic UI with Xcode Previews</p>
<p id="hwwdc79">WWDC 2023 Create animated symbols</p>
<p id="hwwdc78">WWDC 2023 Create rich documentation with Swift-DocC</p>
<p id="hwwdc77">WWDC 2023 Design dynamic Live Activities</p>
<p id="hwwdc76">WWDC 2023 Discover String Catalogs</p>
<p id="hwwdc75">WWDC 2023 Expand on Swift macros</p>
<p id="hwwdc74">WWDC 2023 Explore pie charts and interactivity in Swift Charts</p>
<p id="hwwdc86">WWDC 2023 Animate symbols in your app</p>
<p id="hwwdc85">WWDC 2023 Bring widgets to life</p>
<p id="hwwdc84">WWDC 2023 Bring widgets to new places</p>
<p id="hwwdc83">WWDC 2023 Build accessible apps with SwiftUI and UIKit</p>
<p id="hwwdc82">WWDC 2023 Build programmatic UI with Xcode Previews</p>
<p id="hwwdc81">WWDC 2023 Create animated symbols</p>
<p id="hwwdc80">WWDC 2023 Create rich documentation with Swift-DocC</p>
<p id="hwwdc79">WWDC 2023 Debug with structured logging</p>
<p id="hwwdc78">WWDC 2023 Design dynamic Live Activities</p>
<p id="hwwdc77">WWDC 2023 Discover String Catalogs</p>
<p id="hwwdc76">WWDC 2023 Expand on Swift macros</p>
<p id="hwwdc75">WWDC 2023 Explore pie charts and interactivity in Swift Charts</p>
<p id="hwwdc74">WWDC 2023 Fix failures faster with Xcode test reports</p>
<p id="hwwdc73">WWDC 2023 Generalize APIs with parameter packs</p>
<p id="hwwdc72">WWDC 2023 Keynote</p>
<p id="hwwdc71">WWDC 2023 Make features discoverable with TipKit</p>
Expand Down

0 comments on commit 107ca3e

Please sign in to comment.