The article presents a compiled list of unit tests naming strategy that one could follow for naming their unit tests. The article is intended to be a quick reference instead of going through multiple great pages such as following. That said, to know greater details, please feel free access one of these pages listed below and know for yourself.
Following are 7 popular unit tests naming conventions that are found to be used by majority of developers and compiled from above pages:
My personal favorite is naming unit tests based on the writing features of the class under test. It helps me to make sure that a class follows single responsibility. It also aids a great deal in code refactoring.
Artificial Intelligence (AI) agents have started becoming an integral part of our lives. Imagine asking…
In the ever-evolving landscape of agentic AI workflows and applications, understanding and leveraging design patterns…
In this blog, I aim to provide a comprehensive list of valuable resources for learning…
Have you ever wondered how systems determine whether to grant or deny access, and how…
What revolutionary technologies and industries will define the future of business in 2025? As we…
For data scientists and machine learning researchers, 2024 has been a landmark year in AI…
View Comments
I am a fan of your seventh approach: Given_Preconditions_When_StateUnderTest_Then_ExpectedBehavior. I omit some underscores (GivenPreconditions_WhenStateUnderTest_ThenExpectedBehavior) but it's the same idea.
Thanks Duncan for the comments