From the course: Introduction to Test Classes in Salesforce

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Test-driven development

Test-driven development - Salesforce Tutorial

From the course: Introduction to Test Classes in Salesforce

Start my 1-month free trial

Test-driven development

- There's a lot of emphasis in the development community on test-driven development. In several cases, I've been asked during interviews what my opinion of test-driven development is. I look at test-driven development in two modes. One is in theory and one is in practice. In theory, you want to write a test class. You want to run the test class. The new test class should fail. Then you'll write the code that the test class should be testing. You'll get that code to pass. And then you'll repeat. And this is a process where you'll continue to create your test code in advance and then create the classes that go along with it. That's great in theory. In practice, you typically come into an organization that already has a lot of code and it can be a few hundred lines of code, it can be a couple hundred thousand lines of code. That code has already been written by another developer and in many cases, it may have been several developers that have touched this code. They all have their own…

Contents