Duration: 3 days
Recommended Class Size: 10 to 20
Prerequisites: Basic OO Development
This course takes a pragmatic approach to Test Driven Development (TDD). We believe testing should be a fundamental, integral part of software development process including design and programming. By fundamental, we mean that doing testing well leads to better designs and programs. By integral, we mean that it is part of the normal day-to-day life of the programmer, not a burdensome task added at the end of the real work. Test Driven Development is not always done as Test First Development and it is core to know what to test vs what not to test. The course is a mixture of lecture, short readings, discussion, and labs. Attendees will writing acceptance criteria, functional acceptance tests unit tests. Core testing best practices will be examined included some advanced topics such as organizing tests, test environments, continuous integration, and testing web services. Additionally testing techniques such as using Mock Objects and testing for different qualites such as performance and security are discussed. The attendees will read information about testing, learn the details of the techniques, and apply them in a group setting (preferably to systems they are currently working on).
- Effectively write unit tests in an agile development environment
- Learn how to write maintainable tests
- Isolate test code from code it depends on
- Write well-formed acceptance tests
- Refactor test code and build test suite
- Test for boundary and normal conditions
- Know what to test (and what not to test)
- Write acceptance tests for system qualities
Motivation for refactoring: when and where and why do it?
- How refactoring supports agile object-oriented development
An overview of common “code smells”—signs that code needs to be refactored
- Avoiding cut-copy-paste-modify reuse
Coding best practices: public methods, using inheritance properly,
method size and level of detail, and intentional name
- What is Test-Driven Development?
- Two different TDD rhythms: Test first and test frequently
- Different tests and how they support agile development:
acceptance, function, unit, integration and smoke test
- Effective test and production coding practices
- When tests are run (and who should write them)
- What makes a good unit test?
- What makes a good acceptance test?
- The 10 commandments for testing
- Where tests add value and where they don’t
- How refactoring affects tests
- Organizing and managing tests
- Effective test automation
- Testing external services
- Mocking and techniques for isolating test code
- What makes good assertions?
- The basic structure of a test scenario