iTranslated by AI
[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:
- 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
- The subject of the test (System Under Test)
- Specifically, how to represent that information in test code:
- How to structure using
describeorcontext - How to include necessary information in
testoritusing specific rules
- How to structure using
- 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.
Discussion