Skip to content

Commit

Permalink
chore: 📝 update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Sobolewski committed Jan 20, 2025
1 parent a0da312 commit 3cc0b48
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
43 changes: 25 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ And "Entertainment" total as $100
You can see the implementation of tests and the app, but I recommend you go through the commits to see how the app was developed step by step.

<!-- START_COMMITS -->
### 1. **[test: :test_tube::x: Outline the first scenario and make it fail.](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/f4fc7b34abfe323ba970ba962ab6429a85f4a959)**
### 1. **[test: :test_tube::x: Outline the first scenario and make it fail.](https://github.com/jakubsob/shiny-acceptance-tdd/commit/f4fc7b34abfe323ba970ba962ab6429a85f4a959)**
- Create `tests/acceptance/` directory for acceptance tests.
- Create `.test_acceptance()` command to conveniently run acceptance tests.
- Create acceptance test stage on CI.
Expand All @@ -67,75 +67,82 @@ You can see the implementation of tests and the app, but I recommend you go thro
- Implement domain specific language in a separate file, force verify functions to fail, so that we know our software is not working yet.
- Verify that acceptance tests fail :x:.

### 2. **[test: :test_tube::x: Add Shiny app protocol driver and the first scenario step implementation](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/d7566de0778861ef83fa8c70db7bdd0acfc09878)**
### 2. **[test: :test_tube::x: Add Shiny app protocol driver and the first scenario step implementation](https://github.com/jakubsob/shiny-acceptance-tdd/commit/d7566de0778861ef83fa8c70db7bdd0acfc09878)**
- Create a wrapper for `shinytest::AppDriver` to allow adding our own methods of interacting with the SUT.
- Add a method for interacting with the SUT. It's purpose is to hide the implementation details of how we interact with the SUT. If we ever want to interact with the SUT in another way, we would implement another driver with a method with the same name and interface.
- Call the driver method from the DSL function.
- Tests should fail due to a timeout, tests want to interact with an element that doesn't exist yet :x:.

### 3. **[feat: :test_tube:::x: Implement the input needed by `record_income()` step](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/9ec150c0e2f551286d72afc6c4f1135ee53982e2)**
### 3. **[feat: :test_tube::x: Implement the input needed by `record_income()` step](https://github.com/jakubsob/shiny-acceptance-tdd/commit/6e390fc700f7c84c07634660fb78fd74aceab9a0)**
- Implement the numeric input needed by the first scenario step.
- Run tests to validate that tests pass successfully through `record_income()` step.
- Tests should be still failing due to forced fail in verify function :x:.

### 4. **[test: :test_tube::x: Implement `record_expense()` step](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/0725a3c4dfccf6c534c0aa0ebb098747afb95e56)**
### 4. **[test: :test_tube::x: Implement `record_expense()` step](https://github.com/jakubsob/shiny-acceptance-tdd/commit/e51b87b26a4c965321b3fa5c5997bfe3e7f2b689)**
- Implement `record_expense()` step.
- Run tests to check that tests fail at this step :x:.

### 5. **[feat: :test_tube::x: Implement input needed by `record_expense()` step](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/79f183d346a74888e5e371d776370b928d3daa2d)**
### 5. **[feat: :test_tube::x: Implement input needed by `record_expense()` step](https://github.com/jakubsob/shiny-acceptance-tdd/commit/11b4e71c7dc321b145a68033e5db0af6843b13b8)**
- Implement the numeric input needed by `record_expense()` step.
- Run tests to validate that tests pass successfully through `record_expense()` step.
- Tests should be still failing due to forced fail in verify function :x:.

### 6. **[refactor: :recycle::x: Add buttons to confirm the income and expense input](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/7a47469c0f511081be0df5679324008d4b8b5144)**
### 6. **[refactor: :recycle::x: Add buttons to confirm the income and expense input](https://github.com/jakubsob/shiny-acceptance-tdd/commit/ce0b3f1f231d80c3aadbb209dbe95b9253c8472d)**
- Don't change the DSL, clicking the buttons is a part of `record_income` and `record_expense` actions. This is why not mentioning UI in the DSL matters, as it allows us to refactor the UI without changing the tests.
- Modify the `record_income` and `record_expense` actions to include the button clicks.
- Implement the buttons in production code.
- Tests should be still failing due to forced fail in verify function ❌.

### 7. **[test: :test_tube::x: Implement `verify_total_income()` step](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/6b6e7b5a604a09858b98e36999efe3d4de6b0637)**
### 7. **[test: :test_tube::x: Implement `verify_total_income()` step](https://github.com/jakubsob/shiny-acceptance-tdd/commit/e4592ab43534eb3f491ec3352a7f8d62e65da3fc)**
- We expect that there will be an element from which we extract the numeric value.
- Tests should be still failing, now due a timeout. Total income element is not yet implemented :x:.

### 8. **[feat: :test_tube::x: Implement verifying total income](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/4ea96ba94b53e16da855e429ce82c1acc8f2dd1f)**
### 8. **[feat: :test_tube::x: Implement verifying total income](https://github.com/jakubsob/shiny-acceptance-tdd/commit/167f462bbf5e2d7aae73628ce927172f2760b49b)**
- Implement the business logic of calculating the total based on given income and expenses.
- `verify_total_income()` should pass, other assertions should fail :x:.

### 9. **[test: :test_tube::x: Implement `verify_total_expenses()` step](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/923cd9ceac0f7eeb51eaaa5e1324c4babb5e31e5)**
### 9. **[test: :test_tube::x: Implement `verify_total_expenses()` step](https://github.com/jakubsob/shiny-acceptance-tdd/commit/97f7abb07e77339739fcf4f19f121635f8d713e9)**

### 10. **[feat: :test_tube::x: Implement verifying total expenses](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/30ea44b488d3dd61f5a7be936fe6ee36483e371e)**
### 10. **[feat: :test_tube::x: Implement verifying total expenses](https://github.com/jakubsob/shiny-acceptance-tdd/commit/b18e5fa3337e6b6c6b6e60b7ca0c55185a433710)**
- Add business logic for calculating total expenses.
- Tests should pass `verify_total_expenses()` step. `verify_net_balance()` should fail :x:.

### 11. **[test: :test_tube::x: Implement `verify_net_balance()` step](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/7f643b9ae7fe32c1cf94126742762cbb1568e733)**
### 11. **[test: :test_tube::x: Implement `verify_net_balance()` step](https://github.com/jakubsob/shiny-acceptance-tdd/commit/1c74835fe0767285175e5e93a6f021a0aa9c9c76)**

### 12. **[feat: :test_tube::white_check_mark: implement verifying net balance](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/c51f3492349047ef962306d57895c167819fca8b)**
### 12. **[feat: :test_tube::white_check_mark: implement verifying net balance](https://github.com/jakubsob/shiny-acceptance-tdd/commit/346933384ff638a06212a3ce6349134a4fed0daf)**
- Add business logic to verify net balance.
- All assertions should pass :white_check_mark:.

### 13. **[refactor: :recycle::white_check_mark: Refactor inputs to a components module](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/c0f4df2f31b3f4965d80c4a391931e6f32c6c7f7)**
### 13. **[refactor: :recycle::white_check_mark: Refactor inputs to a components module](https://github.com/jakubsob/shiny-acceptance-tdd/commit/f6c6ffd4d2694f63c541b4eef0c9ecd209ef207e)**
- We can safely refactor the code, we will know if code still works as long as tests are passing.

### 14. **[test: :test_tube::white_check_mark: Add a second scenario](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/adae8cd3e901a81c8e3048ea42fafb7e6d0df130)**
### 14. **[test: :test_tube::white_check_mark: Add a second scenario](https://github.com/jakubsob/shiny-acceptance-tdd/commit/a2ceb04ba1ba87dc88be6a8e7d23f0d0add46f6f)**
- Add a second test scenario to test if we can record multiple expenses.
- Reuse existing steps to create a new scenario.
- Implement a teardown function to allow running multiple scenarios.

### 15. **[test: :test_tube::x: Create specification for the registry – interface for persistent storage](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/72d31a62cc661b545aa25e4181a90f6b6c76867b)**
### 15. **[test: :test_tube::x: Create specification for the registry – interface for persistent storage](https://github.com/jakubsob/shiny-acceptance-tdd/commit/d23b8d5b33125f4e6c2db50e201691f51c1267ba)**
- Add unit tests for an object that the app will interact with to store data to a persistent storage.
- I want to use a `registry` object to run operations on a `storage` object. The storage will be a CSV file, but it could as well be a database connection or a S3 bucket.
- This is an implementation detail of the app, it doesn't change the behavior of the app – tests are added to `tests/testthat/`, no changes in acceptance tests are needed.

### 16. **[test: :test_tube::x: Add specification for CSV storage](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/f7b572f3bb29a14cc95ae58c18792edf2a73fa32)**
### 16. **[test: :test_tube::x: Add specification for CSV storage](https://github.com/jakubsob/shiny-acceptance-tdd/commit/14c46a8a137cb8d5ef3fd7fd4ed44a6ef51bbe94)**
- Create a specification for an interface that will connect the app with a CSV file.

### 17. **[feat: :test_tube::white_check_mark: Add implementation of the storage and registry](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/d30de11879113cadbe2f4dc821d796b8cdc4fb49)**
### 17. **[feat: :test_tube::white_check_mark: Add implementation of the storage and registry](https://github.com/jakubsob/shiny-acceptance-tdd/commit/6a2e6bc3b90b007e88c7900d63bb2e37384d90f3)**
- Create an implementation objects perviously specified in tests.
- Leave the doors open for other implementations of interfaces so that we could extend the implementation to use a database or a S3 bucket.
- The new code is not used in the app code yet. We will do that in the next commits.

### 18. **[feat: :test_tube::white_check_mark: Integrate storage code with the app](https://github.com/jakubsob/acceptance-tdd-shiny-development/commit/fb6049716eea6eda29b8e20745c35d637969f7a8)**
### 18. **[feat: :test_tube::white_check_mark: Integrate storage code with the app](https://github.com/jakubsob/shiny-acceptance-tdd/commit/a95de52380ee0edbc8eb900e6f63a5babeb291e3)**
- Use new interface of saving inputs in the app.
- Update the acceptance test so that each test case uses it's own storage, making them independent of each other.

### 19. **[refactor: :recycle::white_check_mark: Refactor the interface of the app](https://github.com/jakubsob/shiny-acceptance-tdd/commit/a0da3127a32b89d07247c5816c7e46bbbf7f2baf)**
- With the Users' needs satisfied (acceptance tests are passing), we can work on improving the style of the app.
- We can move and style elements on the page any way we want.
- As long as we don't change `data-test` attributes or types of elements, acceptance tests will pass.
- If we change the type of component, e.g. numeric input to a dropdown, we only need to change the implementation of interaction with this component.


<!-- END_COMMITS -->
2 changes: 1 addition & 1 deletion scripts/list-commits.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Set the repository URL
REPO_URL="https://github.com/jakubsob/acceptance-tdd-shiny-development"
REPO_URL="https://github.com/jakubsob/shiny-acceptance-tdd"

# Create README.md if it doesn't exist
if [ ! -f README.md ]; then
Expand Down

0 comments on commit 3cc0b48

Please sign in to comment.