iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📝

[Slides] Naming Unit Tests: Talk at JaSST nano vol.38

に公開

Hello. I am bun913, a dedicated fan of Dragon Quest: The Adventure of Dai.

Today, I gave a presentation at JaSST nano vol.38 with the following materials.

I am sharing those materials here.

Summary of Content

  • I finished reading the following book as part of my studies on unit testing:

https://www.artofunittesting.com/

  • I shared tips on naming for tools that use the XSpec format for unit testing, such as Jest, Vitest, and RSpec.
  • Three pieces of information to include when naming:
    • The subject of the test (System Under Test)
      • This usually corresponds to the name of the function being tested.
    • Under what circumstances (scenario or input)
    • Expected behavior
  • Specifically, how to represent that information in test code:
    • How to structure using describe or context
    • How to include necessary information in test or it using specific rules
  • Introduced actual code examples, advantages, and disadvantages for each approach.

Background of the Presentation

I have worked in several roles, including web developer and AWS engineer, and have been actively learning about testing.

In that process, I have organized concepts such as "the benefits of unit testing" and "the benefits/goals of integration testing."

Building on that, I plan to continue sharing my organized thoughts step-by-step on topics like "how to write production code that makes testing easier" and "how to write unit tests."

This time, although it's a relatively small topic, I spoke about "naming unit tests."

I will continue to provide output, not just input, regarding testing in the future. Thank you for your support.

GitHubで編集を提案

Discussion