Book Image Enterprise Architecture

By : Andrew Fawcett
Book Image Enterprise Architecture

By: Andrew Fawcett

Overview of this book

Table of Contents (20 chapters) Enterprise Architecture
About the Author
About the Reviewers

Unit testing versus system testing

When it comes to testing the Apex code, we know the drill: write good tests to cover your code, assert its behavior, and obtain at least 75 percent coverage. will not allow you to upload packaged code unless you obtain this amount or higher. You also have to cover your Apex Trigger code, even if it's only a single line, as you will soon see is the case with the implementation of the Apex Triggers in this book.

When it comes to unit testing, what currently lacks, however, is a mocking framework to permit more focused and isolated testing of the layers mentioned in the previous sections without having to set up all the records needed to execute the code you want to test. This starts to make your Apex tests feel more like system-level tests having to execute the full functional stack each time.

While conventions such as test-driven development (TDD) are possible, they certainly help you think about developing true unit tests on the platform...