Join Simon Allardice for an in-depth discussion in this video Creating a test in Eclipse, part of Foundations of Programming: Test-Driven Development.
- [Voiceover] I'm going to do a test-driven…development cycle in Eclipse here…using Java as the language with JUnit as the library.…But again, I will be as generic as I can.…The language and the IDE is not the focus here.…So even if you are a Java and Eclipse person,…focus less on the syntax and specific menu items…and just more on the overall approach.…So I have no code at all.…I have an empty project here,…and I know I want to make that simple…BankAccount class I described a moment ago.…So this is test-driven development.…We begin not by adding that class,…but by first adding a unit test.…
So I'm creating a JUnit test case here…and I get this dialog box.…Now this is a place I can often hear that resistance.…Well, how am I supposed to create…a meaningful unit test or even know what to name it,…which is what it's asking for right now,…when I have nothing to test.…Well, it is true that we have no code.…But I do have an intention…and we always have an intention when creating our test.…I know that I want to make a BankAccount class.…
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