w3c / network-emulation

Documenting how capturing network traces and using it to emulate real-world network conditions can be helpful for Web developers
9 stars 2 forks source link

Improve Use Cases #3

Open flyingzl opened 3 years ago

flyingzl commented 3 years ago

It seems that the Use Cases are still WIP, hopefully we can improve them. Maybe the use cases should cover the following items:

sudeepdi commented 3 years ago

Apart from webpage tests, as mentioned by #1 by acbegen, it would be got to understand the sensitivity of QoE to variations in network conditions (throughput, etc.) for cloud gaming, streaming, PWA, etc. apps. This data will help defining the scope Network Emulation Tool in Browser applicability and requirements. Can we discuss this in the upcoming NetEmu WNIG meeting?

sudeepdi commented 3 years ago

Use-case for Network Emulation Tool usage: PWA Application Testing. Inputs gathered from PWA experts on potential use-cases where Network Emulation Tool can help:

christianliebel commented 3 years ago

@sudeepdi I'd like to second that. Robust network emulation tools would also be important for PWA developers.

  • Emulating network conditions to test how PWA app handles sporadic timeouts due to dynamic network conditions. Also, evaluate QoE impact as a result of that. Based on test results, like significant QoE impact, the developer can begin to devise solutions to address the issue.

The developer tools I know of allow you to turn off the network entirely, or to restrict the bandwidth to a certain throughput. Dynamic network conditions are difficult to simulate, so I'm not sure how well PWAs out there deal with them (i.e., one of your sync requests went through, but the next one runs into a timeout).

  • Test Service workers, including handling of cases when Background traffic (Background Fetch, Background Sync, Periodic Background Sync APIs) is impacted (delayed or lost) due to mobility reasons (moving from high coverage to low coverage mobile cell)”

That's another important point. Some of the aforementioned APIs are triggered by the browser/service worker, and not by you as a developer, so testing your code under real-life conditions is hard.

  • Emulating specific online, unreliable or offline states based on the URL to test Offline-first models.

Chrome DevTools have a feature called network request blocking where you can block network requests based on URL patterns. PWA developers typically have the problem that they still want to retrieve the latest source files from their development server (say, http://localhost), but want to simulate an offline state or unstable connection for the backend (http://localhost/api or https://example.com/api). Turning off the network entirely or recreating the service worker after each change is cumbersome.