Serial Wire Debug (SWD) is a 2-pin electrical alternative JTAG interface that shares a common functional protocol with JTAG for processor debug.
Since SWD is an alternative physical protocol to JTAG, it can leverage much of the existing knowledge, techniques and tooling that exist for JTAG. However, SWD is typically not used for scan-testing.