Repository of Ruby katas for Acceptance Test-Driven Development (ATDD) and Behavior-Driven Development (BDD), from unit tests to full web apps.
- Language: Ruby
- Testing Frameworks:
- RSpec for unit testing
- Cucumber for acceptance testing (BDD)
- Web Framework: Sinatra
- Testing Tools:
- Capybara for web application testing
- Rack-Test for HTTP testing
- SimpleCov for test coverage reporting
- Template Engine: ERB
A simple calculator implementation demonstrating basic Test-Driven Development (TDD) practices.
- Features: Addition and division operations
- Testing: Unit tests with RSpec using Arrange-Act-Assert pattern
- Learning Focus: Basic TDD workflow and test structure
Tennis scoring system implementation, a classic coding dojo exercise.
- Features: Tennis game scoring logic including deuce scenarios
- Testing: Unit tests for game state management
- Learning Focus: Complex business logic testing and state management
E-commerce pricing calculator with regional tax and volume discount features.
- Features: Dynamic pricing based on volume discounts and country-specific tax rates
- Testing: Unit tests for business rule validation
- Learning Focus: Business rule testing and edge case handling
Multi-language greeting web application.
- Features: Time-aware greetings in different languages
- Testing: Web interface testing with Capybara
- Learning Focus: Web application testing and user interaction flows
Web-based tennis scoring system.
- Features: Interactive tennis game with live scoring
- Testing: Cucumber features for user stories
- Learning Focus: Full-stack BDD with user story acceptance criteria
Fighting game simulation with character selection and combat mechanics.
- Features: Character selection, combat system, and winner determination
- Testing: Comprehensive acceptance tests for game flow
- Learning Focus: Complex user journey testing and state transitions
Project template providing scaffolding for new ATDD projects.
- Purpose: Standardized structure for creating new exercises
- Includes: Base Gemfile, directory structure, and configuration files
- Red-Green-Refactor cycle
- Unit test structure (Arrange-Act-Assert)
- Test isolation and independence
- User story definition with Cucumber
- Gherkin syntax for readable acceptance criteria
- Living documentation through executable specifications
- End-to-end testing with Capybara
- User interaction simulation
- Cross-browser testing strategies
- Spanish and English feature files
- Internationalization testing approaches
- Cultural context in user acceptance criteria
- Ruby (version 2.7 or higher recommended)
- Bundler gem
cd [project-directory]
bundle install
For unit tests (RSpec):
rspec
For acceptance tests (Cucumber):
cucumber
For web applications:
rackup # Start the server
cucumber # Run acceptance tests
This repository serves as a comprehensive learning resource for:
- Software Developers: Learning TDD and BDD practices
- QA Engineers: Understanding acceptance testing strategies
- Team Leads: Implementing quality-driven development processes
- Students: Hands-on experience with testing methodologies
Each project builds upon previous concepts, creating a progressive learning path from basic unit testing to complex web application testing scenarios.
- Test isolation and independence
- Clear test naming conventions
- Separation of concerns in test organization
- Living documentation through executable specifications
- Continuous integration readiness
- Coverage reporting and quality metrics
When adding new exercises:
- Use the template/ directory as a starting point
- Follow the established testing patterns
- Include both unit and acceptance tests where applicable
- Provide clear documentation for learning objectives