Join Simon Allardice for an in-depth discussion in this video What you need to know, part of Programming Foundations: Test-Driven Development.
- This is a course you should watch once you feel reasonably comfortable developing in a general purpose, object-oriented programming language, something like Java, C#, Objective-C, Python and so on because I expect at least basic object-oriented development skills here, being able to write and understand classes, methods, conditions, iterations, values and objects. I'm gonna take all of that as a baseline, so I can talk about how to add TDD practices on top of it. A question I sometimes get is does test driven development replace or conflict with other things I've been learning or hearing about like object-oriented design or refactoring or agile methodologies? And no, test driven development doesn't conflict with those at all.
In fact, it's entirely complementary, and many are what might be considered best practice skills and techniques of professional enterprise developers. Things like refactoring, Scrum are often fond hand in hand with using TDD. So, how are we going to learn this? As with most of these foundations of programming courses, I want you to find this one useful for many different languages. But test driven development isn't just some idea. This isn't an academic ivory tower theoretical thing you only do on a whiteboard.
This is an intensely practical, hands-on, in the code technique. So I will show it being used in a few different languages. But regardless of language or environment, it is based on some core ideas that really don't care which language you use. So expect that when I can, I will teach this as generically as possible, often using either pseudo code or simple Java code, but we'll get more into that in a moment. With that in mind, let's cover exactly what test driven development is and clear up some of the misconceptions and misunderstandings people have about it.
The course explores the jargon of TDD—test suites, test harness, mock and stub objects, and more—and covers how TDD is used in the most common programming languages and environments. Plus learn to create, run, and manage the tests and move to a test-first mindset.
- What is test-driven development?
- Using unit testing frameworks
- Creating tests
- Using assertions
- Creating multiple test methods
- Naming unit tests and test methods
- Testing return values
- Setting up and tearing down
- Introducing mock objects
- Measuring code coverage