Skip to content

Test Coverage Checklist for Enhanced Dynamo DB PRs #6067

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

joviegas
Copy link
Contributor

Motivation and Context

  • Recent changes in Enhanced DDB client caused breaking changes in some , where it would have been caught is there was a test cases covering a specific scenario.
  • Thus composed a Test scenario doc to make sure user/Pr requestor has tesed all the scenarios.

Modifications

  • Added a initial version of Testing scenario, we can add more scenario as we find.

Testing

Test Coverage Checklist

Sample Test Scenario checklist for this PR , since this PR just updated MD file no need of tests, this below is just a demo on how this should be used.

Scenario Done Comments if Not Done
1. Different TableSchema Creation Methods skipped Just Mark Down file Update
2. Nesting of Different TableSchema Types skipped Just Mark Down file Update
3. CRUD Operations skipped Just Mark Down fileUpdate
4. Data Types and Null Handling skipped Just Mark Down file Update
5. AsyncTable and SyncTable skipped Just Mark Down file Update
6. New/Modification in Extensions skipped Just Mark Down file Update
7. New/Modification in Converters skipped Just Mark Down fileUpdate

Screenshots (if appropriate)

License

  • I confirm that this pull request can be released under the Apache 2 license

@joviegas joviegas requested a review from a team as a code owner April 28, 2025 19:52
@joviegas joviegas force-pushed the joviegas/ddb-testing-instructions branch from a9c8b5a to 5439829 Compare April 28, 2025 19:54
@joviegas joviegas force-pushed the joviegas/ddb-testing-instructions branch from 5439829 to 942d804 Compare April 28, 2025 20:22
| c. TableSchema.documentSchemaBuilder().build() | [ ] | |
| d. StaticTableSchema.builder(Customer.class) | [ ] | |
| **2. Nesting of Different TableSchema Types** | | |
| a. @DynamoDbBean with nested @DynamoDbBean as NonNull | [ ] | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does NonNull mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in null reference , updated to make it clear

Comment on lines 42 to 47
| **4. Data Types and Null Handling** | | |
| a. top-level null attributes | [ ] | |
| b. collections with null elements | [ ] | |
| c. maps with null values | [ ] | |
| d. conversion between null Java values and AttributeValue | [ ] | |
| e. full serialization/deserialization cycle with null values | [ ] | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a DDB noob, I don't really know what this means... Can we point out to existing test cases or test classes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated a reference table also mentioned a link below

- [Reference for Data Types and Null Handling](https://github.com/aws/aws-sdk-java-v2/blob/master/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/document/EnhancedDocumentTestData.java)

```md
## Test Coverage Checklist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to categorize the changes and specify tests required for each category?

For example:

  • Adding/updating an annotation
    • Add tests for all TableSchemas
      • ...
  • Adding/updating an API in DynamoDbTable
    • Add tests for ...
  • Adding/updating CRUD operations
  • Adding/updating Extensions
    ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While initially I thought of categorizing it , but I believe we should maintain a comprehensive checklist approach rather than categorizing tests by change type. Here's why:

  1. Test cases represent independent DynamoDB features that can be impacted by various types of changes
  2. Categorization might inadvertently narrow focus to specific test areas, potentially missing edge cases
  3. A complete checklist ensures thorough coverage regardless of the change type
  4. PR reviewers can verify all relevant test cases are addressed
  5. For tests already covered, contributors can simply reference existing coverage

Most scenarios are already addressed in our test suite, but a comprehensive checklist approach helps us proactively identify gaps rather than discovering issues later in the development cycle.

For now, I think a complete checklist is more practical and ensures we don't miss anything important. We could consider developing a structured categorization approach in the future when we have time to properly map all test scenarios. What do you say?

Copy link

sonarqubecloud bot commented May 5, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants