Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write better test cases titles #158

Open
0xjei opened this issue Feb 12, 2024 · 0 comments
Open

Write better test cases titles #158

0xjei opened this issue Feb 12, 2024 · 0 comments
Labels
tests 🧪 Adding missing or correcting existing tests

Comments

@0xjei
Copy link
Member

0xjei commented Feb 12, 2024

Context

The zk-kit packages test cases ('it') follows the same format. Some of them seems unclear and can be improved (e.g., Should not import a tree if it the exported tree is not defined).

Approach

We can define a more strict convention that must be followed for the definition of clearer test case statements.

Guidelines

  • Clear and Descriptive Titles: Ensure each test case clearly describes what it tests.
  • Behavior-Driven Phrasing: Use BDD-style phrasing, often starting with "should," to describe expected behavior.
  • Specificity: Be specific about what each test case is verifying, especially regarding conditions and expected outcomes.
  • Single Aspect Testing: Aim to test one aspect or behavior in each it block to simplify diagnosis when tests fail.
  • Consistent Structure: Maintain a consistent structure and phrasing style across all test descriptions for readability and maintainability.
  • Reflect User Stories: Where possible, align test cases with user stories or requirements to ensure they meet the specified criteria.
  • Language Consistency: Use consistent language and tense (present simple or future simple) throughout your test descriptions.

References

@0xjei 0xjei added the tests 🧪 Adding missing or correcting existing tests label Feb 12, 2024
@0xjei 0xjei added this to ZK-Kit Feb 12, 2024
@cedoor cedoor moved this to 📋 Backlog in ZK-Kit Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests 🧪 Adding missing or correcting existing tests
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant