Test Data Creation for Apex E2E Testing

If your Salesforce org is anything like ours, its complex. To prevent regression, complex and meaningful tests are required. In our situation, E2E tests depend on a lot of configuration records, before they can perform their operations. Today I focus on how to...

Why We Do Test-Driven Development (TDD)

Test-Driven Development (TDD) is funny: Most developers hesitantly agree we should do it more often. Yet, I rarely see a whole team doing it. It seems to me, most of us still don’t understand why it is so powerful. As a result, some of us still reject it...

A Library To Mock SObject Records

If you plan to write solid unit tests in Salesforce, you won’t get around mocking sobjects. A solid testing strategy needs a powerful library to mock sobject records. This allows you to write loosely coupled tests without the need to insert records into the...

Solve „Unable To Lock Row“ Error In Tests

There seems to be a soft limit for E2E tests in Salesforce. Once you hit it, your tests will start to fail with the dreaded „unable to lock row“ exception. This is one of the nastiest errors you can encounter, especially in tests. It’s hard to debug...

5 Signs You Suck At Testing Apex

This is a rant full of sarcasm. Reader discretion advised. However, if you believe that „customers won’t pay for quality“ and that „testing your apex code slows you down“ this text is for you. You are part of the problem. In the last...