Introduction

Writing test cases is somewhat easier than writing application code. However, it is easy to forget the dos and don’ts when writing test code. Fortunately, many best practices are considered universal when writing test code. These practices are transferable and applicable from one test project to the next. We will look at the most important ones below. Each best practice has a quiz question to further test your understanding of that particular section.

Tests must exclude control structures

The application code handles control structures and the test code tests them. If the test code handled control structures, it too would be prone to failure. We do not want failure-prone tests because this would defeat the purpose of testing.

Get hands-on with 1200+ tech skills courses.